package com.fegin.api;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author:RenPu
 * @Date: 2020/8/29 14:02
 * @Version: 1.0
 * @description:
 */

@RestController
@Slf4j
public class HystrixFallbackController {

    @Resource
    private MyService myService;

    @GetMapping("error")
    public String error() {
        return myService.error();
    }

    @GetMapping("/timeout")
    public String timeout(@RequestParam Integer timeout) {
        return myService.retry(timeout);
    }


}
